home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / wpj1_8.zip / GASH.ZIP / INSTANCE / INSTANCE.C next >
Text File  |  1993-08-16  |  519b  |  27 lines

  1. /*
  2.  
  3. INSTANMCE.C - Get the HINSTANCE of a DLL from a given HMODULE
  4.               (C) 1993, Dennis CHUAH
  5.  
  6. */
  7.  
  8.  
  9. #define STRICT
  10. #include <windows.h>
  11. #include <windowsx.h>
  12. #include <instance.h>
  13.  
  14.  
  15. HINSTANCE WINAPI GetDllModuleInstance (HMODULE hModule)
  16.   {static char path[256];
  17.    HINSTANCE hInstance;
  18.  
  19.    if (GetModuleFileName (hModule, path, 256) == 0) return NULL;
  20.    hInstance = LoadLibrary (path);
  21.    if (hInstance == NULL) return NULL;
  22.    FreeLibrary (hInstance);
  23.    return hInstance;
  24.   }
  25.  
  26.  
  27.